package com.njiandan.johnson.vr360;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.njiandan.johnson.vr360library.VrPlayerActivity;

public class MainActivity extends AppCompatActivity {

    private TextView textView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        textView = (TextView) findViewById(R.id.txtH);

        textView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                String filePath = "android.resource://" + getPackageName() + "/" + R.raw.demo_video;
                Intent intent = new Intent();
                intent.setClass(MainActivity.this, VrPlayerActivity.class);
                intent.putExtra(VrPlayerActivity.VIDEO_PATH, filePath);
                intent.putExtra(VrPlayerActivity.IMAGE_MODE, false);
                intent.putExtra(VrPlayerActivity.PLANE_MODE, true);
                intent.putExtra(VrPlayerActivity.WINDOW_MODE, false);
                startActivity(intent);
            }
        });
    }
}
